//导入mysq1模块
const mysql = require('mysql2')
const config = require('./config');
//创建数据库连接对象
const db = mysql.createPool({
    host: config.database.host,
    user: config.database.user,
    password: config.database.password,
    database: config.database.database
})
//向外共享db数据库连接对象
module.exports = db